package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.BaseVirtualWarehouseMapper;
import com.sumi.erp.domain.BaseVirtualWarehouse;
import com.sumi.erp.service.IBaseVirtualWarehouseService;

/**
 * 虚拟仓库Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-28
 */
@Service
public class BaseVirtualWarehouseServiceImpl implements IBaseVirtualWarehouseService 
{
    @Autowired
    private BaseVirtualWarehouseMapper baseVirtualWarehouseMapper;

    /**
     * 查询虚拟仓库
     * 
     * @param id 虚拟仓库主键
     * @return 虚拟仓库
     */
    @Override
    public BaseVirtualWarehouse selectBaseVirtualWarehouseById(Long id)
    {
        return baseVirtualWarehouseMapper.selectBaseVirtualWarehouseById(id);
    }

    /**
     * 查询虚拟仓库列表
     * 
     * @param baseVirtualWarehouse 虚拟仓库
     * @return 虚拟仓库
     */
    @Override
    public List<BaseVirtualWarehouse> selectBaseVirtualWarehouseList(BaseVirtualWarehouse baseVirtualWarehouse)
    {
        return baseVirtualWarehouseMapper.selectBaseVirtualWarehouseList(baseVirtualWarehouse);
    }

    /**
     * 新增虚拟仓库
     * 
     * @param baseVirtualWarehouse 虚拟仓库
     * @return 结果
     */
    @Override
    public int insertBaseVirtualWarehouse(BaseVirtualWarehouse baseVirtualWarehouse)
    {
        baseVirtualWarehouse.setCreateTime(DateUtils.getNowDate());
        return baseVirtualWarehouseMapper.insertBaseVirtualWarehouse(baseVirtualWarehouse);
    }

    /**
     * 修改虚拟仓库
     * 
     * @param baseVirtualWarehouse 虚拟仓库
     * @return 结果
     */
    @Override
    public int updateBaseVirtualWarehouse(BaseVirtualWarehouse baseVirtualWarehouse)
    {
        return baseVirtualWarehouseMapper.updateBaseVirtualWarehouse(baseVirtualWarehouse);
    }

    /**
     * 批量删除虚拟仓库
     * 
     * @param ids 需要删除的虚拟仓库主键
     * @return 结果
     */
    @Override
    public int deleteBaseVirtualWarehouseByIds(Long[] ids)
    {
        return baseVirtualWarehouseMapper.deleteBaseVirtualWarehouseByIds(ids);
    }

    /**
     * 删除虚拟仓库信息
     * 
     * @param id 虚拟仓库主键
     * @return 结果
     */
    @Override
    public int deleteBaseVirtualWarehouseById(Long id)
    {
        return baseVirtualWarehouseMapper.deleteBaseVirtualWarehouseById(id);
    }
}
